package com.xw.strategy;

/**
 * @author: xw
 * @create: 2022/9/14 14:19
 * @description:
 */
public class Cat implements Comparable<Cat> {
    int height,weight;

    public Cat(int height, int weight) {
        this.height = height;
        this.weight = weight;
    }
    @Override
    public int compareTo(Cat cat){
        if(this.weight < cat.weight) {
            return -1;
        } else if(this.weight >cat.weight){
            return 1;
        }else{
            return 0;
        }
    }

    @Override
    public String toString() {
        return "Cat{" +
                "height=" + height +
                ", weight=" + weight +
                '}';
    }


}
